package com.jcy.jcyrxjava.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

import com.jcy.jcyrxjava.R;

public class AnimActivity extends AppCompatActivity {
    ImageView iv_1;
    Button button1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim);
        iv_1 = findViewById(R.id.iv_1);
        button1 = findViewById(R.id.button_1);

        Animation translateAnim = AnimationUtils.loadAnimation(this,R.anim.iv_1);
        translateAnim.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {

            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        iv_1.startAnimation(translateAnim);

//        Animation scaleAnim = AnimationUtils.loadAnimation(this,R.anim.iv_2);
//        iv_1.startAnimation(scaleAnim);
//
//        Animation rotateAnim = AnimationUtils.loadAnimation(this,R.anim.iv_3);
//        iv_1.startAnimation(rotateAnim);
//
//        Animation alphaAnim = AnimationUtils.loadAnimation(this,R.anim.iv_4);
//        iv_1.startAnimation(alphaAnim);
    }
}